package output;

import java.io.*;
import java.text.*;
import java.util.*;

public class CreateTxt {
	
	private String name;
	private FileWriter info;
	private File file;
	private Writer wr;
	//private ArrayList<String> input_txt;
	private Date d;
	
	public CreateTxt(){
		
		
		file = new File("/Users/giuliabiffi/Desktop/risultati_ricerca.txt");
		
	}
	
	public void createT(String n ,ArrayList<String> arlist){
		
		try {
			
			wr = null;
			//info = new FileWriter("/Users/giuliabiffi/Desktop/risultati_ricerca.txt");
			
			wr = new BufferedWriter(new FileWriter("/Users/giuliabiffi/Desktop/risultati_ricerca.txt",true));
			
			wr.write(n);
			
			for (String s : arlist) {		
				
				
				wr.write("\n"+s+"\n");	
			}
			
			
			System.out.println(info);
			
		} catch (IOException e) {
			
			e.printStackTrace();
		}
			finally {                      
			 
				if (wr != null) try {
					
					wr.close();
				}catch (IOException ioe2) {
				   
				 }
			}	    
			
	}
}
